from socket import *
import os

path_file = r"D:\123.txt"


def trans_file():  # 发送文件
    f = open(path_file, mode="rb")  # 读取字节
    temp = True
    while temp:
        temp = f.read(256)
        tcp_client_socket.send(temp)
    f.close()


ip = "192.168.0.105"
port = 6666
address = (ip, port)
data_size = 1024
tcp_client_socket = socket(AF_INET, SOCK_STREAM)
tcp_client_socket.connect(address)
trans_file()

tcp_client_socket.close()
